package communication.common.business.chat;

import communication.common.business.base.FcrSocketAddress;
import communication.common.vertx.net.ProtocolEnum;

/**
 * 聊天通信用的service
 * @author  zxl
 */
public interface ChatService {

    /**
     * 发送消息给 remoteSocketAddress
     * @param protocolEnum 协议类型
     * @param msg 要发送的消息
     * @param remoteSocketAddress  消息接收端
     * @Exception  throws 发送失败时抛出异常
     */
    void sendChatMsg(ProtocolEnum protocolEnum , String msg, FcrSocketAddress remoteSocketAddress) throws Exception;


    /**
     *  处理接收到的聊天信息
     * @param msg 聊天信息
     * @param remoteSocketAddress socket地址
     */
   void handleChatMsg(String msg, FcrSocketAddress remoteSocketAddress);

}
